#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int my_strstr(char* arr1, char* arr2, int len1, int len2)
{
	int i = 0; int j = 0;
	while (i < len1&&j < len2)
	{
		if (arr1[i]==arr2[j])
		{
			i++;
			j++;
		}
		else
		{
			i = i - j + 1;
			j = 0;
		}
	}
	if (j == len2)
		return i - len2;
	else
		return 0;
}
int main()
{
	char arr1[] = "abcdef";
	char arr2[] = "cde";
	int len1 = strlen(arr1);
	int len2 = strlen(arr2);
	int ret=my_strstr(arr1, arr2, len1, len2);
	for (int i=ret; i < len1; i++)
	{
		printf("%c", arr1[i]);
	}
	return 0;
}